﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FilStartUps.DAL;
using FilStartUps.Helper;

namespace FilStartUps.Admin
{
    public partial class AddModerator : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void txtsubmit_Click(object sender, EventArgs e)
        {
            using (FilStartUpsEntities db_connect = new FilStartUpsEntities())
            {
                Member member = new Member();
                member.emailaddress = txtemail.Text.Trim();
                member.confirmemailaddress = txtemail.Text.Trim();
                member.password = Helper.Helper.HashPassword(txtpassword.Text.Trim());
                member.confirmpassword = Helper.Helper.HashPassword(txtpassword.Text.Trim());
                member.member_flag = true;
                member.datejoined = DateTime.Now;
                member.roleidFK = 2;
                db_connect.Members.Add(member);
                db_connect.SaveChanges();
            }
        }
    }
}